package main;

import java.io.BufferedWriter;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.util.List;

import com.google.common.collect.Multiset.Entry;

public class Outputing {
  public void fileOutput(List<? extends Object> arrayList, String fileName) throws IOException {
    File uniqFile = new UniqueFileCreator(fileName).uniqFile();
    fileOutput(arrayList, uniqFile);
  }

  public void fileOutput(List<? extends Object> arrayList, File file) throws IOException {
    BufferedWriter writer = new BufferedWriter(new FileWriter(file));
    for (Object ent : arrayList) {
      writer.write(ent.toString() + "\n");
    }
    writer.close();
  }

  public void printOutput(List<Entry<String>> arrayList) {
    for (Entry<String> ent : arrayList) {
      System.out.println(ent);
    }
  }
}
